Example: Visu ST Dialog
Product: CODESYS Visualization
This example uses three sample applications to show how to programmatically access visualization dialogs in the Structured Text (ST) implementation language.
Description
The example shows the implementation of how to open dialogs and pass parameters to this dialog. The visualization user can open the dialogs and enter data. After closing the dialog, the entered data will be saved and displayed in the main window.
Additional information
Application: DialogVarInOut
This example shows how to open dialogs programmatically and how to implement the event handler to read and check input values.
The EditBoxEventHandler event handler is set in the PLC_PRG main program. The VariableWritten method is called after an input value has been set. The range of the input value is checked with the CheckValue method of the ControlFB function block. The OK button is enabled when the pVar variable is less than 100.
Note
Note that the ControlFB function block is provided with the VAR_IN_OUT_AS_POINTER attribute when it is passed to the frame.
Application: FileDialog
This example shows how to use the dialog manager to implement the opening of file dialogs in the ST implementation language.
In the PLC_PRG program, the file filter and an instance of the Visu_FbFileListProvider function block are created. The Visu_FbFileListProvider function block is used by the dialog to list and filter files. The OpenFileDialog function sets the Visu_FbFileListProvider and opens the dialog.
The visualization user can now select a file. The name of the file is displayed.
For more information, see:
Application: IECOpenDialog
The example shows how to use the Visu Utils library to open dialogs.
System requirements and restrictions
| Programming system | CODESYS Development System (version 3.5.16.1 or higher) | 
| Runtime system | CODESYS Control Win (version 3.5.16.1) | 
| Add-on components | - | 
Note
 DOWNLOAD Project
 DOWNLOAD Project